package com.nil.codegen.config;

import com.nil.codegen.filter.JwtAuthenticationTokenFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FilterConfig {

    @Bean
    public FilterRegistrationBean<JwtAuthenticationTokenFilter> jwtAuthenticationTokenFilterRegistration() {
        FilterRegistrationBean<JwtAuthenticationTokenFilter> registration = new FilterRegistrationBean<>();
        registration.setFilter(new JwtAuthenticationTokenFilter());
        registration.addUrlPatterns("/*");
        registration.setName("JwtAuthenticationTokenFilter");
        return  registration;
    }

}
